﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using points.Model;

namespace points.AppInfo
{
    public static class AppVars
    {
        public static string CUSTOMER_SELECT = "";
        public static string CUSTOMER_INSERT = "";
        public static string CUSTOMER_UPDATE = "";

        public static Dictionary<string, TypeTable> locale;
        public static Dictionary<string, TypeTable> transaction_type;
        public static Dictionary<string, TypeTable> billinfo_type;
        public static Dictionary<string, TypeTable> customer_type;
        public static Dictionary<string, TypeTable> phone_type;
        public static Dictionary<string, TypeTable> customer_status_type;
        public static Dictionary<string, TypeTable> address_type;

        public static void InitializeVars()
        {
           locale = Util.GetAllFromGenericTypeTable("locale");
           transaction_type =  Util.GetAllFromGenericTypeTable("transaction_type");
           billinfo_type = Util.GetAllFromGenericTypeTable("billinfo_type");
           customer_type = Util.GetAllFromGenericTypeTable("customer_type");
           phone_type = Util.GetAllFromGenericTypeTable("phone_type");
           customer_status_type = Util.GetAllFromGenericTypeTable("customer_status_type");
           address_type = Util.GetAllFromGenericTypeTable("address_type");
        }

        public static string StringNotNull(string s)
        {
            string result = "";

            if(!string.IsNullOrEmpty(s))
            {
                result = s.Trim();
            }

            return result;
        }
    }
}